package com.hancher.api;

import com.hancher.bean.MoneyDTO;

import java.util.HashMap;
import java.util.List;

import io.reactivex.rxjava3.core.Observable;
import okhttp3.RequestBody;
import retrofit2.Response;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.HeaderMap;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

public interface SupabaseApiService {


    //region 交易

    /**
     * 计数
     */
    @GET("money")
    Observable<Response<List<Object>>> countMoney(@HeaderMap HashMap<String, String> headers, @QueryMap HashMap<String, String> map);

    /**
     * 查询
     */
    @GET("money")
    Observable<List<MoneyDTO>> selectMoney(@HeaderMap HashMap<String, String> headers, @QueryMap HashMap<String, String> map);

    /**
     * 查询 带总数的
     */
    @GET("money")
    Observable<Response<List<MoneyDTO>>> selectMoney2(@HeaderMap HashMap<String, String> headers, @QueryMap HashMap<String, String> map);

    /**
     * 查询 带总数的
     */
    @GET("money")
    Observable<List<MoneyDTO>> selectMoney3(@HeaderMap HashMap<String, String> headers, @QueryMap HashMap<String, String> map, @Query("tradeTime") String finishTime);

    /**
     * 插入、更新
     */
    @POST("money")
    Observable<List<String>> insertOrUpdateMoney(@Body RequestBody requestBody, @HeaderMap HashMap<String, String> headers);
    //endregion
}
